//
//  AdvertisementController.m
//  ProjectForCustomer
//
//  Created by 钟游 on 2019/8/25.
//  Copyright © 2019年 钟游. All rights reserved.
//

#import "AdvertisementController.h"
#import "LoginViewModel.h"
#import "AdvertisentMainView.h"
#import "LoginController.h"
@interface AdvertisementController ()
@property(nonatomic,strong)AdvertisentMainView * mainView;
@property(nonatomic,strong)LoginViewModel * viewModel;
@end

@implementation AdvertisementController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBarHidden = YES;
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    self.navigationController.navigationBarHidden = NO;
}
-(void)zy_getNewData{
    
    [self.viewModel.wbSubject sendNext:nil];

}
-(void)zy_addSubviews{
    self.mainView.frame = self.view.bounds;
    [self.view addSubview:self.mainView];
}
-(void)zy_bindViewModel{
    [[self.viewModel.weiSubject takeUntil:self.rac_willDeallocSignal] subscribeNext:^(id  _Nullable x) {
        LoginController * login =[[LoginController alloc]init];
        [self.navigationController pushViewController:login animated:YES];
    }];
}
#pragma mark --lazy
-(AdvertisentMainView *)mainView{
    if (!_mainView) {
        _mainView=[[AdvertisentMainView alloc]initWithViewModel:self.viewModel];
    }
    return _mainView;
}
-(LoginViewModel *)viewModel{
    if (!_viewModel) {
        _viewModel=[[LoginViewModel alloc]init];
    }
    return _viewModel;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
